package demo;

public class Operater {
    private Movies[] movies;

    public Operater(Movies[] movies) {
        this.movies = movies;
    }
    //1、用于展示系统全部的电影信息
    public void Print(){
        System.out.println("------系统全部电影信息如下-----");
        for (int i = 0; i < movies.length; i++) {
            Movies m = movies[i];
            System.out.println("编号："+m.getId());
            System.out.println("名称："+m.getName());
            System.out.println("价格："+m.getPrice());
            System.out.println("-------------------------------");
        }
    }
    //2、根据电影的编号查询该部电影的详细信息并展示：
    public void Show(int id){
        for (int i = 0; i < movies.length; i++) {
            Movies m = movies[i];
            if (m.getId() == id) {
                System.out.println("该部电影的详细信息如下：");
                System.out.println("编号："+m.getId());
                System.out.println("名称："+m.getName());
                System.out.println("价格："+m.getPrice());
                System.out.println("得分："+m.getSroce());
                System.out.println("导演："+m.getDirector());
                System.out.println("主演："+m.getActor());
                System.out.println("其他信息："+m.getInfo());
            }else {
                System.out.println("没有该部电影的信息~~~");
            }
        }
    }
}
